package com.xinz.model;

import java.util.ArrayList;
import java.util.List;

import com.google.code.morphia.annotations.Embedded;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

@Entity(noClassnameStored = true)
public class PlayerAchievement extends BaseModel{

	@Id
	private String id;
	
	@Embedded
	private List<Achievement> achievements = new ArrayList<Achievement>();
	
	public PlayerAchievement() {
		
	}
	
	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}

	public void setAchievements(List<Achievement> achievements) {
		this.achievements = achievements;
	}

	public List<Achievement> getAchievements() {
		return achievements;
	}

	@Entity(noClassnameStored = true)
	public static class Achievement extends Heart{
		private int id;			// 成就ID
		private int progress;	// 当前已完成进度
		private int status;		// 成就状态（已完成或进行中）
		
		public Achievement(int id, int progress, int status) {
			this.id = id;
			this.progress = progress;
			this.status = status;
			super.setUpdateTime();
		}
		
		public void setId(int id) {
			this.id = id;
		}
		public int getId() {
			return id;
		}
		public void setProgress(int progress) {
			this.progress = progress;
			super.setUpdateTime();
		}
		public int getProgress() {
			return progress;
		}
		public void setStatus(int status) {
			this.status = status;
			super.setUpdateTime();
		}
		public int getStatus() {
			return status;
		}
		
		
	}
}
